home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: How to get a random string each time??
- Date: 22 Feb 96 01:21:52 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.824952112@rscernix>
- References: <4fh5od$qq0@news.nevada.edu> <4g4c5m$tlb@news.nevada.edu> <4gg4tj$s18@bcarh8ab.bnr.ca>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4gg4tj$s18@bcarh8ab.bnr.ca> hwt@bnr.ca (Henry Troup) writes:
-
- >In article <4g4c5m$tlb@news.nevada.edu>,
- >Clapton Chan <chancl@nevada.edu> wrote:
- >...
- >> for(i=0; i<10; i++) {
- >...
- >> if...
- >> break;
- >> }
- >>
- >...
- >> j = j%i; /* this handles early program exit */
- >
- >I know a couple of people who would jump up and down and yell about
- >access to a loop index variable outside of the loop. And I know a
- >language that made it impossible.
-
- What language? It was "illegal" in very old FORTRAN (pre-F77), but only
- if the DO-loop terminated normally (it was OK to use the loop index if
- the loop was left via a GO TO).
-
- >I guess in C this is well defined, but it's still on my private list of
- >things not to do again.
-
- Why? It's a very convenient method to tell how the loop was terminated.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-